<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('更改道路')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-update-road">
        <input name="id" type="hidden" th:value="${id}"/>
        <div class="form-group">
            <label class="col-sm-3 control-label">设备名称：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" th:value="${name}" readonly
                       name="name"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">更改道路：</label>
            <div class="col-sm-8">
                <select id="road" name="roadId" class="form-control select2-multiple">
                    <option th:each="road:${roads}" th:value="${road.id}"
                            th:text="${road.name}"
                            th:selected="${road.Roadflag}"
                    ></option>
                </select>
            </div>
        </div>

    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<script type="text/javascript">
    $("#form-user-sim").validate({
        rules: {
            sim: {
                required: true,
                minlength: 20,
                maxlength: 20
            },
        },
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(ctx + "equipment/equipment/edit", $('#form-update-road').serialize());
        }
    }

    $(function () {
        $('#road').select2({
            placeholder: "暂时不指定",
            allowClear: true
        });
    })
</script>
</body>

</html>
